package com.frame;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.frame.study1simplest.SimplestActivity;
import com.frame.study2rxjava.RxFrameActivity;
import com.frame.study2rxjava.RxJavaActivity;

/**
 * retrofit 最简单的使用
 */
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button btnSimplest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btnSimplest = findViewById(R.id.btn_simplest);

        btnSimplest.setOnClickListener(this);
        findViewById(R.id.btn_rxjava).setOnClickListener(this);

        findViewById(R.id.btn_rxjava_frame).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_simplest:
                startActivity(new Intent(MainActivity.this, SimplestActivity.class));
                break;
            case R.id.btn_rxjava:
                startActivity(new Intent(MainActivity.this, RxJavaActivity.class));
                break;
            case R.id.btn_rxjava_frame:
                startActivity(new Intent(MainActivity.this, RxFrameActivity.class));
                break;
            default:
                break;
        }
    }
}
